package top.cluski.feieprint;

import jakarta.annotation.Resource;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import top.cluski.feieprint.api.teable.entity.RecordAddEntity;
import top.cluski.feieprint.api.youzan.YouzanApi;
import top.cluski.feieprint.config.FeiEConfig;
import top.cluski.feieprint.utils.FeiEPrintUtils;

@SpringBootApplication
@EnableScheduling
public class FeieprintApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(FeieprintApplication.class, args);
    }

    @Resource
    FeiEConfig feiEConfig;

    @Resource
    YouzanApi youzanApi;

    @Override
    public void run(String... args) throws Exception {
        FeiEPrintUtils.feiEConfig = feiEConfig;

        RecordAddEntity.youzanApi = youzanApi;
    }
}
